import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: "/homepage",
  },
  {
    path: '/main',
    name: 'main',
    component: () => import(/* webpackChunkName: "about" */ '../views/HomeView.vue'),
    // 重定向，自动跳转到指定路由
    redirect: "/homepage",
    //嵌套路由
    children: [
      {
        path: '/homepage',
        name: '凭证转换',
        component: () => import("@/views/AboutView.vue"),
      },
      {
        path: '/cardGenera',
        name: '卡片生成',
        component: () => import("@/views/mainData/cardGenera.vue"),
      },
      {
        path: '/taxiContractor',
        name: '出租车承包人',
        component: () => import("@/views/mainData/taxiContractor.vue"),
      },
      {
        path: '/contractFile',
        name: '合同档案',
        component: () => import("@/views/mainData/contractFile.vue"),
      },
      {
        path: '/specialFunds',
        name: '专项资金',
        component: () => import("@/views/mainData/specialFunds.vue"),
      },
      {
        path: '/bankAccounts',
        name: '银行账户',
        component: () => import("@/views/mainData/bankAccounts.vue"),
      },
      {
        path: '/merchantFile',
        name: '客商档案',
        component: () => import("@/views/mainData/merchantFile.vue"),
      },
      {
        path: '/projectFile',
        name: '项目档案',
        component: () => import("@/views/mainData/projectFile.vue"),
      },
      {
        path: '/accountSubject',
        name: '会计科目',
        component: () => import("@/views/mainData/accountSubject.vue"),
      },
      {
        path: '/assetClass',
        name: '资产分类',
        component: () => import("@/views/mainData/assetClass.vue"),
      },
      {
        path: '/deptFile',
        name: '部门档案',
        component: () => import("@/views/mainData/deptFile.vue"),
      }
    ]
  },
  {
    path: "/:pathMatch(.*)*",
    name: "notFound",
    component: () => import(/* webpackChunkName: "about" */ '../views/nofoundPage.vue'),
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
